home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SGI Varsity Update 1998 August
/
SGI Varsity Update 1998 August.iso
/
dist
/
dist6.5
/
il_dev.idb
/
usr
/
include
/
il
/
ilArithLutImg.h.z
/
ilArithLutImg.h
Wrap
C/C++ Source or Header
|
1998-07-29
|
3KB
|
96 lines
#if 0
Copyright (c) 1991 SGI All Rights Reserved
THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI
The copyright notice above does not evidence any
actual or intended publication of such source code,
and is an unpublished work by Silicon Graphics, Inc.
This material contains CONFIDENTIAL INFORMATION that
is the property of Silicon Graphics, Inc. Any use,
duplication or disclosure not specifically authorized
by Silicon Graphics is strictly prohibited.
RESTRICTED RIGHTS LEGEND:
Use, duplication or disclosure by the Government is
subject to restrictions as set forth in subdivision
(c)(1)(ii) of the Rights in Technical Data and Computer
Software clause at DFARS 52.227-7013, and/or in similar
or successor clauses in the FAR, DOD or NASA FAR
Supplement. Unpublished- rights reserved under the
Copyright Laws of the United States. Contractor is
SILICON GRAPHICS, INC., 2011 N. Shoreline Blvd.,
Mountain View, CA 94039-7311
#endif
/*
ilArithImg is an abstract class that handles arithmetic operators that
can use lut's. It is derived from ilLutImg and has two virtuals that are
operator specific.
*/
#ifndef _ilArithLutImg_h_
#define _ilArithLutImg_h_
#include <il/ilLutImg.h>
class ilArithLutImg : public ilLutImg {
public:
iflClassListDeclare
ilArithLutImg(ilImage* inImg);
~ilArithLutImg();
// external api: begin
void setScale(double scl) {scale = scl;}
double getScale() {return scale;}
void setBias(double bs) {bias = bs;}
double getBias() {return bias;}
void enableLut(int enable=TRUE) { lutEnabled = enable; setAltered(); }
int isLutEnabled() { return lutEnabled; }
// external api: end
protected:
void resetOp();
ilStatus calcPage(void* inBuf, void* outBuf, ilMpCacheRequest& req);
virtual void calcRow(iflDataType inType, void* ilBuf, void* outBuf,
int sx, int lim,
int x, int y, int z, int c, ilMpCacheRequest& req)=0;
virtual void loadLut()=0;
ilStatus checkMinMax(double min, double max);
double scale, bias;
private:
int lutEnabled;
};
#endif
#define ilArithDoRow(_inType) \
if (1) { \
switch (_inType) { \
case iflUChar: _ilArithDoDtype(u_char); break; \
case iflShort: _ilArithDoDtype(short); break; \
case iflUShort: _ilArithDoDtype(u_short); break; \
case iflFloat: _ilArithDoDtype(float); break; \
case iflDouble: _ilArithDoDtype(double); break; \
default: assert(0); break; \
} \
} else
#define _ilArithDoDtype(_inType) \
if (1) { \
switch (getDataType()) { \
case iflChar: ilArithDoCalc(char, _inType); break; \
case iflUChar: ilArithDoCalc(u_char, _inType); break; \
case iflShort: ilArithDoCalc(short, _inType); break; \
case iflUShort: ilArithDoCalc(u_short, _inType); break; \
case iflInt: ilArithDoCalc(int, _inType); break; \
case iflUInt: ilArithDoCalc(u_int, _inType); break; \
case iflFloat: ilArithDoCalc(float, _inType); break; \
case iflDouble: ilArithDoCalc(double, _inType); break; \
case iflBit: assert(0); break; \
} \
} else